import logging
import ray
import time
from trade.data.table_edit import get_table_edit_obj
from trade.ray_task_control import get_task_control_obj, task_doc_list


if __name__ == "__main__":
    ray.init(resources={"binance_data": 3, "task_trace": 1})
    obj = get_task_control_obj()
    for x in task_doc_list:
        obj.set_job_func.remote(x["func"], x["task_name"])
    get_table_edit_obj()
    logging.info("ray init")
    while True:
        time.sleep(30)
        logging.info("heart beat")
